<template>
    <div class="pages">
        <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
        <van-sticky>
            <div class="header">
                <div class="fls" @click="$router.back(-1)">
                    <img src="../../../static/images/icon-back.png" alt="">
                </div>
                <div class="centern">团队名称业绩</div>
                <div class="fls"></div>
            </div>
        </van-sticky>
        <div class="inttopset"></div>

        <div class="iboixusb">
            <div class="iyejisd">
                <div class="headers">
                    <div class="activeus" v-for="(item,index) in listbens" :key="index" @click="activetypes(index)">
                        <div :class="activestar == index ? 'titlexet' :''">{{item}}</div>
                        <div :class="activestar == index ? 'xian' :''"></div>
                    </div>
                </div>
                <div class="datatoday">
                    <div class="topbaerker">
                        <div class="shopingto">
                            <div class="nameshop">商户总数</div>
                            <div class="number">123</div>
                        </div>
                        <div class="shopingto">
                            <div class="nameshop">交易额(元)</div>
                            <div class="number">123</div>
                        </div>
                        <div class="shopingto">
                            <div class="nameshop">交易笔数</div>
                            <div class="number">123</div>
                        </div>
                    </div>
                    <div class="topbaerker">
                        <div class="shopingto">
                            <div class="nameshop">活跃商户</div>
                            <div class="number">123</div>
                        </div>
                        <div class="shopingto">
                            <div class="nameshop">商户平均交易额</div>
                            <div class="number">123</div>
                        </div>
                        <div class="shopingto">
                            <div class="nameshop">商户平均笔数</div>
                            <div class="number">123</div>
                        </div>
                    </div>
                    <div class="topbaerker">
                        <div class="shopingto">
                            <div class="nameshop">新增商户</div>
                            <div class="number">123</div>
                        </div>
                        <div class="shopingto">
                            <div class="nameshop">笔均单价(元)</div>
                            <div class="number">123</div>
                        </div>
                        <div class="shopingto">
                            <div class="nameshop">疑似流失商户</div>
                            <div class="number underline">123</div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 本月交易金额分时走势 -->
            <div class="tendency">本月交易金额分时走势</div>
            <div class="tendencyDetail">
                <div class="tendency_header">
                    <div class="poercks" v-for="(item,index) in tendencylist" :key="index" @click="tendency_hea(index)">
                        <div :class="tendencyactive == index ? 'usertext':''">{{item}}</div>
                        <div :class="tendencyactive == index ? 'xianser':''"></div>
                    </div>
                </div>
                <div class="ibodyeterbox">

                </div>
            </div>

            <!-- 业绩详情 -->
            <div class="tendency">业绩详情</div>

                <!-- 选项卡切换 -->
                <div class="xuanxiangja">
                    <div class="xuanxiang_header">
                        <div class="iboxclick" @click="activerset(index)" :class="listactive == index ? 'activeser' : ''"  v-for="(item,index) in list" :key="index">
                            <div class="name_set">{{item}}</div>
                            <div :class="listactive == index ? 'xian' : ''"></div>
                        </div>
                    </div>

                    <div class="timnerinsertb">
                        <div class="flleft">
                            <div class="usenber" v-for="(item,index) in bbaclass" :key="index" :class="adusser == index ? 'abeuusbf' :'' " @click="intebba(index)">{{item}}</div>
                        </div>
                        <div class="frright" @click="ishouwdesi()">
                            <div class="titlester">筛选指标</div>
                            <img src="../../../static/images/icon-date-sxzb.png" alt="">
                        </div>
                    </div>

                    <div class="designation">
                        <div class="intebs">团队名称</div>
                        <div class="intebsf" @click="injiaoyi()">
                            <div class="nameubfs">交易金额</div>
                            <img v-if="manny == 0" src="../../../static/images/iocn-sort-down.png" alt="">
                            <img v-if="manny == 1" src="../../../static/images/iocn-sort-up.png" alt="">
                        </div>
                        <div class="intebsf" @click="frequency()">
                            <div class="nameubfs">交易笔数</div>
                            <img v-if="frequencytow == 0" src="../../../static/images/iocn-sort-down.png" alt="">
                            <img v-if="frequencytow == 1" src="../../../static/images/iocn-sort-up.png" alt="">
                        </div>
                        <div class="intebsf" @click="wholesale()">
                            <div class="nameubfs">大额笔数</div>
                            <img v-if="wholesaletress == 0" src="../../../static/images/iocn-sort-down.png" alt="">
                            <img v-if="wholesaletress == 1" src="../../../static/images/iocn-sort-up.png" alt="">
                        </div>
                    </div>

                    <div class="designationsin" v-for="(item,index) in 10" :key="index">
                        <div class="intebs">团队名称</div>
                        <div class="intebsf">
                            <div class="nameubfsfv">1234567890</div>
                        </div>
                        <div class="intebsf">
                            <div class="nameubfsfv">1234567890</div>
                        </div>
                        <div class="intebsf">
                            <div class="nameubfsfv">123456789012345678901234567890</div>
                        </div>
                    </div>

                </div>
            
        </div>

        <van-action-sheet v-model="showbeautiful" title="筛选条件">
            <div class="content">
                <div class="contentList">
                    <div class="icuebfs" :class="{subeberoff:item.bOn}" v-for="(item,index) in icuebfs" :key="index" @click="checkbox(index)">
                        <div class="intebsclass">{{item.titles}}</div>
                        <img v-show="item.bOn == true" src="../../../static/images/setyrbu.png" alt="">
                    </div>
                </div>
                <div class="isok">确定</div>
            </div>
        </van-action-sheet>


    </van-pull-refresh>
        <!-- 底部 -->
        <!-- <van-tabbar v-model="active" active-color="#3288FF" inactive-color="#4F4F4F">
            <van-tabbar-item icon="setting-o" replace to="/index">
                <span>首页</span>
                <img slot="icon" slot-scope="props" :src="props.active ? icon.active : icon.normal" />
            </van-tabbar-item>
            <van-tabbar-item icon="setting-o" replace to="/information">
                <span>数据</span>
                <img slot="icon" slot-scope="props" :src="props.active ? search.actives : search.normals" />
            </van-tabbar-item>
            <van-tabbar-item icon="setting-o" replace to="/my">
                <span>我的</span>
                <img slot="icon" slot-scope="props" :src="props.active ? user.actives : user.normals" />
            </van-tabbar-item>
        </van-tabbar> -->
    </div>
</template>

<script>
import { Toast } from 'vant';
import "../../../static/css/information.css";
export default {
    beforeCreate () {
        document.querySelector('body').setAttribute('style', 'background:#f5f5f5')
    },
    // beforeDestroy () {
    //     document.querySelector('body').setAttribute('style', '')
    // },
    data(){
        return{
            // 下拉刷新
            isLoading: false,

            showbeautiful:false,
            //首页
            icon: {
                normal: require("../../../static/images/icon-home-def.png"),
                active: require("../../../static/images/icon-home-sel.png")
            },
            //数据
            search: {
                normals: require("../../../static/images/icon-date-def.png"),
                actives: require("../../../static/images/icon-date-sel.png")
            },
            //我的
            user:{
                normals: require("../../../static/images/icon-user-def.png"),
                actives: require("../../../static/images/icon-user-sel.png")
            },
            show: false,
            active: 1,

            listbens:['昨日','本周','本月'],
            activestar:0,
            tendencylist:['交易金额','交易笔数','活跃商户','新增商户'],
            tendencyactive:0,


            // 交易金额
            manny:0,
            // 交易笔数
            frequencytow:0,
            // 大额笔数
            wholesaletress:0,
            list:['团队','业务经理','直属商户'],
            listactive:0,

            bbaclass:['昨日','本周','本月','上月'],
            adusser:0,

            icuebfs:[
                {titles:'交易金额',bOn:false},{titles:'交易笔数',bOn:false},{titles:'大额笔数',bOn:false},{titles:'笔单价',bOn:false},{titles:'新增商户',bOn:false},
                {titles:'商户数',bOn:false},{titles:'新增终端',bOn:false},
                {titles:'终端数',bOn:false},{titles:'日均活跃商户',bOn:false},{titles:'日均交易金额日均交易金额',bOn:false},{titles:'日均交易笔数',bOn:false}
            ],
        }
    },
    created(){
        document.querySelector('body').setAttribute('style', 'background:#f5f5f5')
    },
    methods:{
        // 跳转业绩明细
        performanceSubsidiary(){
            this.$router.push({ name: "performanceSubsidiary" });
        },
        activetypes(index){
            this.activestar = index
        },
        // 本月交易金额分时走势
        tendency_hea(index){
            this.tendencyactive = index
        },
        // 交易金额
        injiaoyi(){
            if(this.manny == 0){
                this.manny = 1
            }else{
                this.manny = 0
            }
        },
        // 交易笔数
        frequency(){
            if(this.frequencytow == 0){
                this.frequencytow = 1
            }else{
                this.frequencytow = 0
            }
        },
        // 大额笔数
        wholesale(){
            if(this.wholesaletress == 0){
                this.wholesaletress = 1
            }else{
                this.wholesaletress = 0
            }
        },
        activerset(index){
            this.listactive = index
        },

        intebba(index){
            this.adusser = index
        },
        ishouwdesi(){
            this.showbeautiful = true
        },
        // 多选
        checkbox(i){
            console.log(this.icuebfs)
            this.icuebfs[i].bOn = !this.icuebfs[i].bOn;
        },
        // 下拉刷新
        onRefresh() {
            setTimeout(() => {
                Toast('刷新成功');
                this.isLoading = false;
                this.count++;
            }, 1000);
        },
    }
}
</script>

<style scoped>
page{
    background:rgb(245, 245, 245);
}
    .pages{
        width: 100%;
    }
    .header{
        width: 100%;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        box-sizing: border-box;
        background: #3288FF;
    }
    .header>.fls{
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .header>.fls>img{
        width: 100%;
        height: 100%;
    }
    .centern{
        color: #FFFFFF;
        font-family: OPPOSans;
        font-weight: medium;
        font-size: 17px;
        letter-spacing: 0px;
    }
    .left_fl{
        color: #FFFFFF;
        font-family: OPPOSans;
        font-weight: medium;
        font-size: 17px;
        letter-spacing: 0px;
    }
    .right_fr{
        display: flex;
        align-items: center;
    }
    .right_fr>img{
        width: 24px;
        height: 24px;
    }
    .right_fr>.tettrer{
        color: #FFFFFF;
        font-family: OPPOSans;
        font-weight: medium;
        font-size: 17px;
        letter-spacing: 0px;
        margin-left: 8px;
    }
    .inttopset{
        width: 100%;
        height: 72px;
        background: #3288FF;
        position: absolute;
        top: 44px;
        z-index: -1;
    }
    .iboixusb{
        width: 100%;
        z-index: 99;
        padding: 0 16px;
        box-sizing: border-box;
    }

    .iyejisd{
        width: 100%;
        border-radius: 4px;
        background: #FFFFFF;
    }
    .headers{
        width: 100%;
        height: 44px;
        padding: 0 16px;
        box-sizing: border-box;
        border-bottom: 1px solid #F2F2F2;
        display: flex;
        align-items: center;
    }
    .activeus{
        width: 56px;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        color: #828282;
        font-family: OPPOSans;
        font-weight: regular;
        font-size: 16px;
        letter-spacing: 0px;
        margin-right: 27.5px;
    }
    .titlexet{
        color: #333333;
        font-family: OPPOSans;
        font-weight: medium;
        font-size: 16px;
        letter-spacing: 0px;
    }
    .xian{
        width: 56px;
        height: 4px;
        background: #3288FF;
        position: absolute;
        bottom: 0;
    }
    .datatoday{
        width: 100%;
        padding: 16px;
        box-sizing: border-box;
    }

    .topbaerker{
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
    }
    .topbaerker:nth-child(3){
        margin-bottom: 0;
    }
    .shopingto{
        width: 33.33%;
    }
    .shopingto:nth-child(1){
        width: 30.33%;
        /* background-color: coral; */
    }
    .shopingto:nth-child(2){
        width: 36.33%;
        /* background-color: cyan; */
    }
    .shopingto:nth-child(3){
        width: 30.33%;
        /* background-color: darkgreen; */
    }

    .nameshop{
        color: #828282;
        font-family: OPPOSans;
        font-weight: regular;
        font-size: 14px;
        letter-spacing: 0px;
    }
    .number{
        color: #333333;
        font-family: DIN;
        font-weight: regular;
        font-size: 18px;
        letter-spacing: 0px;
        margin-top: 8px;
    }
    .underline{
        text-decoration:underline;
        color: #EB5757;
    }

</style>